using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class SEO
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region SEOSelectAll
        public static SqlDataReader SEOSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "SEOSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "SEOSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region SEOSelectRow
        public static SqlDataReader SEOSelectRow(int ID, int LangID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "SEOSelectRow", ID, LangID);
            return SqlHelper.ExecuteReader(m_trConnectionString, "SEOSelectRow", ID, LangID);
        }
        #endregion
       #region SEOInsertRow
        public static void SEOInsertRow(int ID, int LangID, string Domain, string Keywords, string Metadata, string Title, string Copyright, string UpdatedUser, DateTime UpdatedDate, bool IsDeleted, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "SEOInsertRow", ID, LangID, Domain, Keywords, Metadata, Title, Copyright, UpdatedUser, UpdatedDate, IsDeleted);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "SEOInsertRow", ID, LangID, Domain, Keywords, Metadata, Title, Copyright, UpdatedUser, UpdatedDate, IsDeleted);
        }
        #endregion
       #region SEOUpdateRow
        public static void SEOUpdateRow(int ID, int LangID, string Domain, string Keywords, string Metadata, string Title, string Copyright, string UpdatedUser, DateTime UpdatedDate, bool IsDeleted, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "SEOUpdateRow", ID, LangID, Domain, Keywords, Metadata, Title, Copyright, UpdatedUser, UpdatedDate, IsDeleted);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "SEOUpdateRow", ID, LangID, Domain, Keywords, Metadata, Title, Copyright, UpdatedUser, UpdatedDate, IsDeleted);
        }
        #endregion
       #region SEODeleteRow
        public static void SEODeleteRow(int ID, int LangID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "SEODeleteRow", ID, LangID);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "SEODeleteRow", ID, LangID);
        }
        #endregion

    }
}

